package models

import (
	"lao-a/helper"
	"lao-a/models/model"
)

const (
	ACCTYPE_WECHAT = "wechat"
)

const (
	PLAT_ACCTYPE_USER   = "user"
	PLAT_ACCTYPE_MEMBER = "member"
)

// GetPlatIDBy 依据第三方账户查本系统人员
func GetPlatIDBy(accType, accID string) (*model.AaAssociateAccount, error) {
	var acc model.AaAssociateAccount
	_, err := Dao.Where("acc_type=?", accType).And("acc_id=?", accID).Get(&acc)
	if err != nil {
		return nil, helper.LogError("查询关联用户失败", err)
	}

	return &acc, nil
}
